Ext.define('Zm.controller.X3d', {
    extend: 'Ext.app.Controller',
    uses:['Zm.Common','Zm.i18n.Lang'],
    refs:[
        {ref:'CardView', selector:'cardview'},
        {ref:'X3dProp', selector:'x3dproperty'},
        {ref:'LineProp', selector:'lineproperty'},
        {ref:'DevTree', selector:'devtree'}
    ],
    init: function(){
        var me = this;
        me.control({
            'x3dview':{
                devclick:me.onDevClick
            }
        });        
	},
    onDevClick:function(view,devid,element,event){
        var me = this,
            lineProp = me.getLineProp();
        me.getDevTree().selectPath(element.getAttribute('spath'),'id','/',function(bSucc,oLastNode){
            var x3dProp = me.getX3dProp();
            if(!bSucc){
                x3dProp.setValue(devid);
                //x3dProp.setTitle('');
            }
        },me);
        lineProp.setValue(devid);
    }
});